<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   mengchen的回复  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({elements: ["bbpress-forums"]});
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/cn/profile/383203/replies/page/10/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466454198: Accept with keywords: (title(0.0):论坛, topn(0.366666666667):大家,帖子,分布,会员,内存,变量名,变量,显著性,样品,Python,假设,例子,参数,方法,正态分布,式子,函数,程序包,检验,问题,命令,普通,用户名,错误,密码,数据,主题,总计,数值,论坛).-->
 </head>
 <body class="bbp-user-page single singular bbpress paged-10 single-author sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    mengchen的回复
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/cn">
       <img src="http://cos.name/cn/wp-content/themes/COS-forest/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <div class="menu-%e8%8f%9c%e5%8d%951-container">
        <ul class="nav-menu" id="menu-%e8%8f%9c%e5%8d%951">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-407772" id="menu-item-407772">
          <a href="http://cos.name/cn/">
           论坛首页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407773" id="menu-item-407773">
          <a href="http://cos.name/cn/forums/">
           讨论区
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407774" id="menu-item-407774">
          <a href="http://cos.name/cn/wp-login.php?action=register">
           注册
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407819" id="menu-item-407819">
          <a href="http://cos.name/">
           主站
          </a>
         </li>
        </ul>
       </div>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-0 type- status-publish hentry" id="post-0">
        <header class="entry-header">
         <h1 class="entry-title">
          mengchen
         </h1>
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <div id="bbpress-forums">
          <div id="bbp-user-wrapper">
           <div id="bbp-single-user-details">
            <div id="bbp-user-avatar">
             <span class="vcard">
              <a class="url fn n" href="http://cos.name/cn/profile/383203/" rel="me" title="mengchen">
               <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=150&amp;d=monsterid&amp;r=g"/>
              </a>
             </span>
            </div>
            <!-- #author-avatar -->
            <div id="bbp-user-navigation">
             <ul>
              <li class="">
               <span class="vcard bbp-user-profile-link">
                <a class="url fn n" href="http://cos.name/cn/profile/383203/" rel="me" title="mengchen的档案">
                 档案
                </a>
               </span>
              </li>
              <li class="">
               <span class="bbp-user-topics-created-link">
                <a href="http://cos.name/cn/profile/383203/topics/" title="mengchen发起的主题">
                 发起的主题
                </a>
               </span>
              </li>
              <li class="current">
               <span class="bbp-user-replies-created-link">
                <a href="http://cos.name/cn/profile/383203/replies/" title="mengchen创建的回复">
                 创建的回复
                </a>
               </span>
              </li>
              <li class="">
               <span class="bbp-user-favorites-link">
                <a href="http://cos.name/cn/profile/383203/favorites/" title="mengchen的收藏夹">
                 收藏夹
                </a>
               </span>
              </li>
             </ul>
            </div>
            <!-- #bbp-user-navigation -->
           </div>
           <!-- #bbp-single-user-details -->
           <div id="bbp-user-body">
            <div class="bbp-user-replies-created" id="bbp-user-replies-created">
             <h2 class="entry-title">
              回复的主题
             </h2>
             <div class="bbp-user-section">
              <div class="bbp-pagination">
               <div class="bbp-pagination-count">
                查看 15 个帖子 - 136 到 150（总计 167 个）
               </div>
               <div class="bbp-pagination-links">
                <a class="prev page-numbers" href="http://cos.name/cn/profile/383203/replies/page/9/">
                 ←
                </a>
                <a class="page-numbers" href="http://cos.name/cn/profile/383203/replies/">
                 1
                </a>
                <span class="page-numbers dots">
                 …
                </span>
                <a class="page-numbers" href="http://cos.name/cn/profile/383203/replies/page/9/">
                 9
                </a>
                <span class="page-numbers current">
                 10
                </span>
                <a class="page-numbers" href="http://cos.name/cn/profile/383203/replies/page/11/">
                 11
                </a>
                <a class="page-numbers" href="http://cos.name/cn/profile/383203/replies/page/12/">
                 12
                </a>
                <a class="next page-numbers" href="http://cos.name/cn/profile/383203/replies/page/11/">
                 →
                </a>
               </div>
              </div>
              <ul class="forums bbp-replies" id="topic-0-replies">
               <li class="bbp-header">
                <div class="bbp-reply-author">
                 作者
                </div>
                <!-- .bbp-reply-author -->
                <div class="bbp-reply-content">
                 帖子
                </div>
                <!-- .bbp-reply-content -->
               </li>
               <!-- .bbp-header -->
               <li class="bbp-body">
                <div class="bbp-reply-header" id="post-393145">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月13日 下午3:41
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/149533/">
                    【疑惑】R function()：ddply参数传递不能包含正则表达式么？
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/149533/#post-393145">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-393145 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-149533 bbp-reply-position-2 user-id-383203 post-393145 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   这个和正则表达是完全没有关系的，这个错误是 变量 的作用范围的问题。
                  </p>
                  <p>
                   方程可以这样写
                  </p>
                  <pre class="highlight ">xandy &lt;- function(a, b) {
  myStr &lt;- paste0(a,'.*',b)
  cp &lt;- paste0(a, '&amp;', b)
  ddply(df2, .(calmonth), function(data, csum_match, coprod_match) {
    summarise(data,
              csum=length(grep(coprod_match, product)),
              coproduct=coprod_match)
  }, csum_match=myStr, coprod_match=cp)
}
</pre>
                  <p>
                  </p>
                  <p>
                   ddply 会根据你的 data.frame 建立一个 local environment，所以你在 ddply 是的变量名称就是这个局部环境中的 变量名称（参见 函数 with。根据我的推测，这两者是一样的道理，如果不对欢迎大家指正）。举个例子，在你的这一句命令中
                  </p>
                  <pre class="highlight ">csum=length(grep(paste0(a,'.*',b),product)),</pre>
                  <p>
                   函数实质上试图寻找的是 df2$a，但是这个变量是不存在的，于是退而求其次，在 global environment 中去寻找a，于是就看到了你说的错误 （“这是因为，a是我之前定义的数据框”）。
                   <br/>
                   当你把 a 和 b 变成 ‘apple’,’&amp;’,’htc’ 时候，就不存在变量名称和范围的问题，就可以工作了。
                  </p>
                  <p>
                   在我上面写的函数中，仅有的改变就是把 a 和 b 以函数的参数的形式来传递。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-393142">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月13日 下午2:58
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/149532/">
                    boxplot y标注超出边界
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/149532/#post-393142">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-393142 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-149532 bbp-reply-position-2 user-id-383203 post-393142 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   方法有很多，可以把边缘扩大，可以把字体缩小。想要那一种？
                   <br/>
                   具体 参见 ?par
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-393123">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月13日 上午9:47
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/149535/">
                    R-主题模型
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/149535/#post-393123">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-393123 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-149535 bbp-reply-position-2 user-id-383203 post-393123 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   如果仅仅是想知道 LDA 的函数的话，MASS包中的 lda 就可以
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-392726">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月9日 上午10:41
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/149207/">
                    利用R比较两组数的差异显著性
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/149207/#post-392726">
                   4 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-392726 -->
                <div class="even bbp-parent-forum-993 bbp-parent-topic-149207 bbp-reply-position-4 user-id-383203 post-392726 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   回复 第3楼 的 zeamxie：
                   <br/>
                   两组样品的 Wilcoxon test 就是 Mann-Whitney test。这种方法和t test有不同的假设。MW是非参数方法（non-parametric）而t test 是有参数的（parametric）。换句话说，有参数就是要求数据服从某种分布，无参数就指对数据的分布没有要求。在参数方法中，通过样品参数来估计对分布参数从而进行检验。对于t test而言，数据分布必须符合正态分布，而MW仅仅假设两个样本具有同样的分布（对于具体什么样的分布没有具体要求）。两者主要不同在于statistical power 和 robustness。在符合正太分布的时候，t test 的statistical power （在备择假设正确时拒绝零假设的概率，即 sensitivity）更高一些，但是如果数据不符合正态分布，MW更准确一些。
                   <br/>
                   这里有个很好的解释
                   <br/>
                   <a href="http://uk.answers.yahoo.com/question/index?qid=20100109093525AAEufIF" rel="nofollow">
                    http://uk.answers.yahoo.com/question/index?qid=20100109093525AAEufIF
                   </a>
                   <br/>
                   有可能打不开，我复制过来
                   <br/>
                   Firstly, allow me to discuss the basic difference between assumptions made in the Mann-Whitney U test and the independent sample t-test.
                  </p>
                  <p>
                   Parametric implies that a distribution is assumed for the population.
                   <br/>
                   Non-parametric implies that there is no assumption of a specific distribution for the population.
                  </p>
                  <p>
                   You use the independent sample t-test when you want to test the mean between two groups of data.
                   <br/>
                   You use the Mann-Whitney U test when you want to test the median between two groups of data.
                  </p>
                  <p>
                   Two independent sample t-test holds the following assumptions:
                   <br/>
                   1) The populations follow normal distributions
                   <br/>
                   2) The two independent samples are equal in size
                   <br/>
                   3) The variances for both populations are identical
                  </p>
                  <p>
                   (There are also t-test with unequal sizes and/or unequal variances, so assumptions to 2) and 3) can be voided.)
                  </p>
                  <p>
                   Mann-Whitney U test holds the following assumptions:
                   <br/>
                   1) The populations do not follow any specific parametrized distributions
                   <br/>
                   1) The populations of interest have the same shape
                   <br/>
                   2) The populations are independent of each other
                  </p>
                  <p>
                   When the assumptions hold, the power of rejecting H₀ when it is false is higher for a parametric test than for a corresponding nonparametric test with equal sample sizes. To put it simply, parametric tests have more statistical power than non-parametric tests.
                   <br/>
                   However, the nonparametric test results are more robust against violation of the assumptions.
                   <br/>
                   Thus, if assumptions are violated for a test based on a parametric model, then the conclusions based upon the parametric test may be more misleading than conclusions based upon nonparametric test.
                  </p>
                  <p>
                   Also, Mann-Whitney U test is more appropriate when dealing with skewed data. This is because the parametric t-test are sensitive towards outliers or extreme values. When a data is skewed, then the position of the mean would be more towards the skewed part of the data. This condition is made more relaxed by the Mann-Whitney U test.
                  </p>
                  <p>
                   But even if the assumptions for the independent sample t-test are well met, the Mann-Whitney U test is hardly less powerful with large enough sample size. Hence, whenever the validity of the parametric assumptions are potentially doubtful, Mann-Whitney U test is used instead.
                  </p>
                  <p>
                   You said that you obtained the same result from both tests. What do you mean by same result? Is it that both tests produce the same hypotheses? i.e. for example, for independent sample t-test, mean is the same, and for Mann-Whitney U test, the median is the same? Or is it that the value of the mean equals the value of the median?
                  </p>
                  <p>
                   Now, if the former is true, then it could be due to both of the data have the same shape/distribution, even if it’s skewed. Therefore, the positions of the mean for both data would be similar, and this also goes to the median. Hence the result. In this case, the Mann-Whitney U test would be more appropriate than the independent sample t-test due to the skewness of the data (not normal), where the mean gives misleading value while the median gives more accurate value of central tendency.
                  </p>
                  <p>
                   If the latter is true, then it is most likely that both data are bell-shaped. (i.e. the mean and the median lies in the centre of the bell-curve. Bell-curve implies normality and hence, assumptions for the independent sample t-test are justified. Now in this case, the independent sample t-test would be more appropriate than the Mann-Whitney U test.
                  </p>
                  <p>
                   Another case when Mann-Whitney U test could be more appropriate than the independent sample t-test is when you use ordinal scale for your data. For example, you used ‘Low’ to represent $10000 below, ‘Medium’ to represent $10000-$25000 and ‘High’ to represent $25000 above. Then you assign ‘Low’=1, ‘Medium’=2, ‘High’=3 (Ranking).
                  </p>
                  <p>
                   So, depending on the situation, each test has its own pros and cons. In any case, whenever the assumptions for a parametric test are justified, there is no way that a non-parametric test will be more statistically powerful, and thus be more appropriate, than a parametric test.
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-392703">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月9日 上午8:01
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/134346/">
                    学习机器学习的前提
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/134346/#post-392703">
                   4 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-392703 -->
                <div class="odd bbp-parent-forum-1006 bbp-parent-topic-134346 bbp-reply-position-4 user-id-383203 post-392703 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   我认为线性代数和微积分是必须的基础。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-392701">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月9日 上午7:58
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/149207/">
                    利用R比较两组数的差异显著性
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/149207/#post-392701">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-392701 -->
                <div class="even bbp-parent-forum-993 bbp-parent-topic-149207 bbp-reply-position-2 user-id-383203 post-392701 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   用 t test （如果数据样品量小） 或者 z test （如果数据样品量大） 检验 log 转化后的数据
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-392578">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月8日 下午1:10
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/149106/">
                    从CRAN上下载了一个程序包，按照手册上的指令运行时出现错误，大家帮忙看看是他的程序包本身就有错误么？？
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/149106/#post-392578">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-392578 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-149106 bbp-reply-position-2 user-id-383203 post-392578 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   这个是 svd 命令，奇异值分解的输入中出现了  missing value 或者 无穷值
                   <br/>
                   具体原因需要 能够重复这个错误的命令 才好判断。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-392146">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月7日 上午10:01
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/105215/">
                    关于如何升级R版本的一个naive的问题
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/105215/#post-392146">
                   9 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-392146 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-105215 bbp-reply-position-9 user-id-383203 post-392146 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   回复 第8楼 的 jasmine_007：这个不错，升级对于R来说确实是个比较痛苦的过程
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-392143">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月7日 上午9:59
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/148721/">
                    无关统计的帖子是否删除？
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/148721/#post-392143">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-392143 -->
                <div class="odd bbp-parent-forum-988 bbp-parent-topic-148721 bbp-reply-position-2 user-id-383203 post-392143 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   大老们肯定是把 R 都刻在骨头里才建的这个论坛的  [s:11]
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-392034">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2014年1月6日 下午6:40
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/148586/">
                    R和Python 之间相互通信
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/148586/#post-392034">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-392034 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-148586 bbp-reply-position-2 user-id-383203 post-392034 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   rPython 包可以直接调用 python 的命令
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-390652">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2013年12月31日 上午8:28
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/147443/">
                    求大矩阵的逆时R容易崩溃吗？
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/147443/#post-390652">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-390652 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-147443 bbp-reply-position-2 user-id-383203 post-390652 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   你的内存有多大？有可能是内存不足。如果是 linux 系统用 top 或者 htop，windows用任务管理器 监控一下内存。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-390495">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2013年12月30日 下午5:06
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/147240/">
                    关于R数据类型转换-带引号的数字-转化为数值
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/147240/#post-390495">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-390495 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-147240 bbp-reply-position-2 user-id-383203 post-390495 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   这个要具体问题具体分析，第二个例子，可以把每一列转化为数值：
                  </p>
                  <pre class="highlight ">xx2 &lt;- apply(xx1, 2, as.numeric)
</pre>
                  <p>
                  </p>
                  <p>
                   但是切记，factor 的本质就是 integer，所以有些情况直接 as.numeric 不能呢个得到你想要的。如果用错了很危险，因为这个也是合理的转化，不会有报错，比如
                  </p>
                  <p>
                  </p>
                  <pre class="highlight ">f1 &lt;- factor(c("1532", "23", "55", "1"))
as.numeric(f1)
as.numeric(as.character(f1))
</pre>
                  <p>
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-390151">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2013年12月28日 下午1:16
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/146751/">
                    请教：如何不使用循环提高计算？
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/146751/#post-390151">
                   2 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-390151 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-146751 bbp-reply-position-2 user-id-383203 post-390151 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   R 中有很多 apply 函数（tapply, lapply, sapply, tapply, mapply, by, ….），根据需要来选择。 plyr 包中也有类似的函数。可以提高运算效率，但并不和 for loop 完全一样。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-389355">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2013年12月26日 下午3:04
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/145933/">
                    关于R里面big number请教
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/145933/#post-389355">
                   3 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-389355 -->
                <div class="even bbp-parent-forum-999 bbp-parent-topic-145933 bbp-reply-position-3 user-id-383203 post-389355 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   在你的式子中，前半部分
                  </p>
                  <pre class="highlight ">choose(3442, ii)</pre>
                  <p>
                   的值是 Inf，
                   <br/>
                   式子的后半部分
                  </p>
                  <pre class="highlight ">(q^ii) * ((1 - q)^(3442 - ii)))</pre>
                  <p>
                   的值是 0.
                   <br/>
                   在R中，
                  </p>
                  <pre class="highlight ">Inf × 0</pre>
                  <p>
                   是 NaN。
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
                <div class="bbp-reply-header" id="post-389351">
                 <div class="bbp-meta">
                  <span class="bbp-reply-post-date">
                   2013年12月26日 下午2:47
                  </span>
                  <span class="bbp-header">
                   回复：
                   <a class="bbp-topic-permalink" href="http://cos.name/cn/topic/146070/">
                    主成分分析结果出现空格，求高手指点
                   </a>
                  </span>
                  <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/146070/#post-389351">
                   3 楼
                  </a>
                  <span class="bbp-admin-links">
                  </span>
                 </div>
                 <!-- .bbp-meta -->
                </div>
                <!-- #post-389351 -->
                <div class="odd bbp-parent-forum-999 bbp-parent-topic-146070 bbp-reply-position-3 user-id-383203 post-389351 reply type-reply status-publish hentry">
                 <div class="bbp-reply-author">
                  <a class="bbp-author-avatar" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   <img src="http://sdn.geekzu.org/avatar/e31607386ca086e18d99194923fe0552?s=80&amp;d=monsterid&amp;r=g"/>
                  </a>
                  <br/>
                  <a class="bbp-author-name" href="http://cos.name/cn/profile/383203/" rel="nofollow" title="查看mengchen的档案">
                   mengchen
                  </a>
                  <br/>
                  <div class="bbp-author-role">
                   普通会员
                  </div>
                 </div>
                 <!-- .bbp-reply-author -->
                 <div class="bbp-reply-content">
                  <p>
                   最好把原数据和命令发上来，如果太大就想办法简化一下，让大家能重复你的输出，才好知道问题在哪。[s:17]
                  </p>
                 </div>
                 <!-- .bbp-reply-content -->
                </div>
                <!-- .reply -->
               </li>
               <!-- .bbp-body -->
               <li class="bbp-footer">
                <div class="bbp-reply-author">
                 作者
                </div>
                <div class="bbp-reply-content">
                 帖子
                </div>
                <!-- .bbp-reply-content -->
               </li>
               <!-- .bbp-footer -->
              </ul>
              <!-- #topic-0-replies -->
              <div class="bbp-pagination">
               <div class="bbp-pagination-count">
                查看 15 个帖子 - 136 到 150（总计 167 个）
               </div>
               <div class="bbp-pagination-links">
                <a class="prev page-numbers" href="http://cos.name/cn/profile/383203/replies/page/9/">
                 ←
                </a>
                <a class="page-numbers" href="http://cos.name/cn/profile/383203/replies/">
                 1
                </a>
                <span class="page-numbers dots">
                 …
                </span>
                <a class="page-numbers" href="http://cos.name/cn/profile/383203/replies/page/9/">
                 9
                </a>
                <span class="page-numbers current">
                 10
                </span>
                <a class="page-numbers" href="http://cos.name/cn/profile/383203/replies/page/11/">
                 11
                </a>
                <a class="page-numbers" href="http://cos.name/cn/profile/383203/replies/page/12/">
                 12
                </a>
                <a class="next page-numbers" href="http://cos.name/cn/profile/383203/replies/page/11/">
                 →
                </a>
               </div>
              </div>
             </div>
            </div>
            <!-- #bbp-user-replies-created -->
           </div>
          </div>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget bbp_widget_login" id="bbp_login_widget-2">
         <h3 class="widget-title">
          登录
         </h3>
         <form action="http://cos.name/cn/wp-login.php" class="bbp-login-form" method="post">
          <fieldset>
           <legend>
            登录
           </legend>
           <div class="bbp-username">
            <label for="user_login">
             用户名:
            </label>
           </div>
           <div class="bbp-password">
            <label for="user_pass">
             密码:
            </label>
           </div>
           <div class="bbp-remember-me">
            <label for="rememberme">
             记住用户名
            </label>
           </div>
           <div class="bbp-submit-wrapper">
            <button class="button submit user-submit" id="user-submit" name="user-submit" tabindex="104" type="submit">
             登录
            </button>
           </div>
           <div class="bbp-login-links">
            <a class="bbp-register-link" href="http://cos.name/cn/wp-login.php?action=register" title="注册">
             注册
            </a>
            <a class="bbp-lostpass-link" href="http://cos.name/cn/wp-login.php?action=lostpassword" title="忘记密码">
             忘记密码
            </a>
           </div>
          </fieldset>
         </form>
        </aside>
        <aside class="widget widget_text" id="text-7">
         <h3 class="widget-title">
          搜索
         </h3>
         <div class="textwidget">
          <form action="http://www.google.com/search" id="bbp-search-form" method="get" onsubmit="Gsitesearch(this)" role="search">
           <div>
           </div>
          </form>
          <form id="bbp-search-form-baidu" onsubmit="g(this)" role="search">
           <div>
           </div>
          </form>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          新鲜事
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/cn/topics/">
             最新帖子
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/popular/">
             最热门主题
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/no-replies/">
             消灭零回复
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          RSS订阅
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/topics/feed/">
             所有主题
            </a>
           </li>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/forums/feed/">
             所有帖子
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
  </div>
 </body>
</html>